package com.abc.invoke.controller;

import com.abc.invoke.bean.User;
import com.abc.invoke.client.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
 * Created by caoyuan7 on 2018/1/17.
 */
@Controller
@RequestMapping(value = "/")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "/user" ,method = RequestMethod.GET)
    public String getUser(Model model){
        User u = userService.getUserbyName("Alvis");
        model.addAttribute("user",u);
        System.out.println(u);
        return "/";
    }

}
